# -*- coding: Latin-1 -*-
#!/usr/bin/env python
'''
Created on 21/11/2011

@author: nmedina
'''
import wx
from wx.lib.embeddedimage import PyEmbeddedImage
import wx.lib.mixins.listctrl  as  listmix
import sys
STYLE_BUSQUEDA_DEFAULT = 0 
STYLE_BUSQUEDA_ARTICULOS = 1
STYLE_NRO_SERIES = 2
STYLE_DISTRIBUCION_STOCK = 3
STYLE_BUSQUEDA_PROVEEDOR = 4
class ListViewExtended(wx.ListCtrl
            ,listmix.ListCtrlAutoWidthMixin
            ,listmix.ListRowHighlighter
            ,listmix.ColumnSorterMixin):
    def __init__(self,parent, id=-1
                 ,pos=wx.DefaultPosition, size=wx.DefaultSize
                 ,style=wx.LC_REPORT|wx.LC_VIRTUAL|wx.LC_HRULES|wx.LC_VRULES, validator=wx.DefaultValidator
                 ,name=""):
        wx.ListCtrl.__init__(self,parent, id, pos,
                             size, style, 
                             validator, name)
        self.__il = wx.ImageList(16,16)
        self.__AddIconos()
        self.__Columnas = {}
        self.__Datos = {}
        self.SetImageList(self.__il,wx.IMAGE_LIST_SMALL)
        self.itemDataMap = self.__Datos
        self.itemIndexMap = self.__Datos.keys()
        self.SetItemCount(len(self.__Datos))
        self.__style = STYLE_BUSQUEDA_DEFAULT
    def __AddIconos(self):
        up = ascendente16x16.GetBitmap()
        self.sm_up = self.__il.Add(up)
        down = descendente16x16.GetBitmap()
        self.sm_down = self.__il.Add(down)
        producto = Producto16x16.GetBitmap()
        self.__Producto = self.__il.Add(producto)
        default = BuscarDefault16x16.GetBitmap()
        self.__Default = self.__il.Add(default)
        proveedor = Proveedor16x16.GetBitmap()
        self.__Proveedor = self.__il.Add(proveedor)
        deposito = Deposito16x16.GetBitmap()
        self.__Deposito = self.__il.Add(deposito)
        CodigoBarra = CodigoBarra16x16.GetBitmap()
        self.__CodigoBarra = self.__il.Add(CodigoBarra)
        CodBarraIncorrecto = CodigoBarraIncorrecto16x16.GetBitmap()
        self.__codBarraIncorrecto = self.__il.Add(CodBarraIncorrecto)
        CodBarraCorrecto = CodigoBarraCorrecto16x16.GetBitmap()
        self.__CodBarraCorrecto = self.__il.Add(CodBarraCorrecto)
    def __GetIcono(self,mStyle,mDatos):
        if  mStyle == STYLE_BUSQUEDA_DEFAULT:
            return self.__Default
        elif mStyle == STYLE_BUSQUEDA_ARTICULOS:
            return self.__Producto
        elif mStyle == STYLE_DISTRIBUCION_STOCK:
            return self.__Deposito
        else:
            return self.__Default
    def AddColumn(self,mIndex ,mLabel,mWidth,mFormat = wx.LIST_FORMAT_LEFT):
        self.InsertColumn(int(mIndex),mLabel,mFormat,mWidth)
        self.__Columnas[mLabel]= {"index" : int(mIndex),"mLabel" : mLabel,"Width"  : mWidth,"Format" : mFormat}
    def RemoveColumn(self,mLabel):
        self.DeleteColumn(self.__Columnas[mLabel]["index"])
        del self.__Columnas[mLabel]
    def GetSortImages(self):
        return (self.sm_up,self.sm_down)
    def LLenar(self,mDatos = [],Style = STYLE_BUSQUEDA_DEFAULT):
        self.__Datos = {}
        self.__Datos = mDatos
        self.__style = Style
        self.itemDataMap = self.__Datos
        self.itemIndexMap = self.__Datos.keys()
        self.SetItemCount(len(self.__Datos))
        listmix.ColumnSorterMixin.__init__(self,len(self.__Columnas))
        listmix.ListCtrlAutoWidthMixin.__init__(self)
        listmix.ListRowHighlighter.__init__(self,"#E0ECF8")
        self.SortListItems(1, 1)
    def GetListCtrl(self):
        return self
    def SortItems(self,sorter=cmp):
        items = list(self.itemDataMap.keys())
        items.sort(sorter)
        self.itemIndexMap = items
        self.RefreshRows()
        self.Refresh()
    def OnGetItemText(self, item, col):
        index=self.itemIndexMap[item]
        s = self.itemDataMap[index][col]
        return s
    def OnGetItemImage(self, item):
        index=self.itemIndexMap[item]
        if  self.__style == STYLE_BUSQUEDA_DEFAULT:
            return self.__Default
        elif self.__style == STYLE_BUSQUEDA_ARTICULOS:
            return self.__Producto
        elif self.__style == STYLE_BUSQUEDA_PROVEEDOR:
            return self.__Proveedor
        elif self.__style== STYLE_NRO_SERIES:
            if self.itemDataMap[index][1]== "No":
                return self.__CodigoBarra
            elif self.itemDataMap[index][1]== "Valido":
                return self.__CodBarraCorrecto
            elif self.itemDataMap[index][1]== "Invalido":
                return self.__codBarraIncorrecto
        elif self.__style == STYLE_DISTRIBUCION_STOCK:
            return self.__Deposito
        else:
            return self.__Default
    def getColumnText(self, index, col):
        item = self.GetItem(index, col)
        return item.GetText()
    def getItemData(self,Item):
        index=self.itemIndexMap[Item]
        return index
                
    
ascendente16x16 = PyEmbeddedImage(
    "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsSAAALEgHS3X78"
    "AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUI"
    "IFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuj"
    "a9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMB"
    "APh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCd"
    "mCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgw"
    "ABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88Suu"
    "EOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHg"
    "g/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgug"
    "dfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7i"
    "JIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/L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M/znhwdti34OIMF5eRdBLeS+5sjIp"
    "7znnqn8NWpg7QVD9q2BGmsjsYNR/GpJ0ADJYnZS3EOI/FUyWV/5cVCFNZfbw0f6iWTIoK6Wb"
    "9+YxZDIpbjonB5o4VUPViFFxzmaHo95iG8OgjYqpUddK1s2vD0fZYzPzBxRsqTa8l9nRVH8x"
    "WhiY6r5PtRpZtzeft7CxUd0S2VUSzMB5d7k/7D0zSTsaFTgIzEzo5L35aOTlZj0nIiVAUG0u"
    "+5DeKYrqo2mx5kNyNknSU7u2gEZtq2r9gxOpDTtj1txQ5RFAiNq8skpf1nVpIGSdQws+pPd3"
    "bBMRmrb9tb62erUq63GSBhzC1PSxHQaiCDgX8D4AQmz3MBAQpLO5UZ9eGa/GI6O+S4M3Ee+B"
    "n0EAEYfzCWbbjqgh2yQEw3BdJ8mb0WiqCd2uuZBk4x/jTzC8GEQCmCe2EVAcgupWoHYUOOdQ"
    "JC+rBnwKLsNiswVxfSMCETDMjCzT771+dw9+UDOcD1RVg1HgfIYnftx2Ya9lQl2374pis/Ih"
    "zWQ7I23TkHVSksTT1BVCJDbNC4CQ9zr7lwm+iNiTuo63dyMuhCRjemaGqqzJ0ux5vclbADl5"
    "/sK+BqqRTj48fu7CtUdZdzhtGlvMUFVCmiTFr/G3pa+f74pzS+9fP+T3ADMSJhC8yzeQAAAA"
    "AElFTkSuQmCC")
    
descendente16x16 = PyEmbeddedImage(
    "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsSAAALEgHS3X78"
    "AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUI"
    "IFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuj"
    "a9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMB"
    "APh+PDwrIs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e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/Xf"
    "Ft1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9D"
    "BY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl"
    "/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz"
    "/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAp5J"
    "REFUeNpsk02IlVUYx3/POef9uh/TOGSTH3UNwcIiV+ouolXQOsEUZtOuDwjB2rgXXIpIq0QY"
    "sFUEQRAtAkHciFBUmwqaq+lcx3vHce7c+77nPedp8U7TjPrsz+/5n////4iqcuGn3WwfVSVN"
    "zfEij28i0RsjhKDqzKz15czqcDT+HmEC4AAQeIIws2fu0PluJz0atSpBEDGEOjGDB+OyKMqz"
    "4w1/1RhpANa4rbch1uze1fvi4L7jb6sGQNpGUoo858frN/j19xFvHHGX07S+XVX84hoB/0uw"
    "4tp5Pj7ZH36DDxuAoZ3N4x69xt93+mRFYDSKrdk5/bCu5ZwDcIlHtQGIcNjr8oFQKaigREQC"
    "a8MUzIRO1yBOUfQd59y3DqCaZuRFhaogQhc1aNi0AyFGx6QcUrQr8lxwqaJIzxh72AGM11so"
    "kGUeRQgRZJuxdVB87f9wTv+xTq0xiPdSqdbjxgNRNtZzYhCy3BODIKJbgCoEJlM+Q813qoox"
    "EeumiMQmBTGyl8i0nLTGQtUNrWqHAojUPs993SrqcexMp6StVnnP2Do6APVrn+8/kHwitEca"
    "s6SKiqpsegCJcfReTr4Kul4r5Wz/r3hx0K8+FdnswYO7j88Ym704/9L6iaCRGOy27UIZpoRk"
    "qWOtYXlJvh7eL8+w+cWmSI560C8/CCHzL+xzp0LUnc2UJonlJV1cuV8tpAXhv/o2KawpLiE8"
    "elgtoAm75uVU0+gmDRFYuRcXV1f8wuOHIawOdMsjUVXytsEl0Hvd8tb7qT14JLtSdOV07ZUk"
    "FVYHYfG3m+XCrR/q8OftgC915+Vtn5nnhWPvpe6ji51rX/48px9f6lx79Zh19tln9xTAAjnQ"
    "KrrSO/pucrboyivAc0AbSJ6E/DsAI485XxBLoR8AAAAASUVORK5CYII=")
Producto16x16 = PyEmbeddedImage(
    "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwY"
    "AAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAINSURBVHja"
    "pNO/axNhGMDx7/PeXa69nDFN2vSnFrVWBUEs1rqJixQnB3UsFHEWQXBQcCy4uPh36ODk4CDi"
    "poOggoGK1No2lTZtNZdLcvc+Dq3YYuLSd3vhfT48v15RVfZz3N2XuVcJTavja3WuoSQK6hjB"
    "NSCizrECz30jH2cn3PZAvSEjq3W9HyXMAKkqKiiOASO4SSJTacK92QnKbYH1mr1RrTGzHoEq"
    "DgKOQGoBhUKgV+OUeeDunxizG2gm6oQZOFUCAbAwmt8GzM7LNFWvYw9ExPpmO3jqMPiBi+8K"
    "430Jyz9haUsRI7YjEHqwVIP3KxbT5TMaf8ZrRZSDs0irxcleyHr/mYLroL1ZGBzwGYoXeFC/"
    "Tdgf8HTsCcnBIZwo4d3XPQns7UF3Bnrynk76X3gY3+HE6DeGzwXcdB9zOv1Eb9ElH0qzIxCE"
    "nh3JVLkVzTE2OI8eP49u1gnWXnOm/Ain+p2evPerYwl9XZZcGLKRXMZmcxi7Co0a6h9lsesS"
    "Xq7AQKTxzoz+BQqBJdtt+DB4HZJDTDSeIbk8ZW+aheI0OYRGM0nBaw9Yx6Uni7QyEHVfoNqw"
    "mCQmLl7kiDhIDBt10Y4lRNWKqTQSq2nTbCC8McMIYH4sImpRk9FG7LlQag/klt++mF+t2kpl"
    "pRiGB1I1DoKATdjc2nL6S6Xq4f6+l0xe+bt8+/3OvwcARqHKUW55Cn8AAAAASUVORK5CYII=")

BuscarDefault16x16 = PyEmbeddedImage(
    "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAC70lEQVQ4jX2Sa0jTURjG/wTV"
    "l4ggikKKMslhqURF0QWLtD50cR9UKhWTaKnLLtMyNbduXpJJUSN1Dq2kKWEL26bIplb/uaZN"
    "s2g63dJda9O5tTlNCHzyLCiq1QMP5+Wc58e5vRQVTKH3ly9Nlh5Zz5JziElN5oJmf1fWog1s"
    "RWlWpdZZqzRD2juGZu0YahQmsKu0zshsRSnJBGejK0IOcF/2yPvG8eHTNFQfp9Cim8Kzfh+a"
    "ej2Q97vxRO3AQd6rHpL9E18Ym6ek1UMedI/6oTG4MWhxQzPsQi09Bn7bOHjNn1EitUPS7cD+"
    "/HaaMD/pFYniC49fWKEyTkJn9sDtm4Z2ZBKGz35YnF9Q/NwGToMVqdUmpFeP4K5sFKuOii/8"
    "3J1ZpHj/2uBFy7sJuL748UjtQnmrE7xnduisXohVDsTybdhx04aIS8MoFI8g6ari/Y9ThOZF"
    "5lV1zcjm7tja74LZ6cON53YUSezIfGiCVOtEk2YCm7gWbLtmRtTlYcSX6cARqGYIS1FhnLiS"
    "+jd4QDtxX/kJbu8UhEoLTomMyK4bgtnhRWGjDVEFRmwtMiLq4gB2F/SiUPgaFIMTR1EhrL1c"
    "IY17bVbkikch6rDDOubDu4/jMNg88H/9hp6hCcTwdNiYM4CIs32IyVPjkuAFCEv+b00a96lb"
    "0GoCS2RAsmAIKff0OF1lnDvqIA4V6zDi8ENv8WBf0VusTqdxvLgLaVyJm7CBV4w4XC6rkeux"
    "J78LWzjdiDjzBuFsLTZka8GYG3dd7sMHkw8anQOrj0lRWj+3xuTLfnXB4sS4tALxbMatTixj"
    "SrAuvQPhLBUYGeqAQ0/S2HzmFfaeb0NmeSdOFDbMEua3Tpofzrqey5cj504nwpIasZzZhJUJ"
    "zQGTem1CI85VdCCX3wKSDdbM86g1KVeY7JrpsjoaObeVSOXKAs653Y6yWhpMtnCaZALZf4ux"
    "fUl0hmhnUpk+PrPSRUxqMkfW/gP+paUUtYDxw6QOru9qeukxq8XapgAAAABJRU5ErkJggg==")
Proveedor16x16 = PyEmbeddedImage(
    "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAA"
    "CXBIWXMAAABIAAAASABGyWs+AAAACXZwQWcAAAAQAAAAEABcxq3DAAABz0lEQVQ4y2NgGPKA"
    "kVQNoqKivD9+/FgkLi4uZ2Bg4MFoZ2fHeeXylbNi4mL/8Wn88vkLu6ioaNHnz5+VraytuFRV"
    "VWdevHjxLYuCgsLvr1++PtfS1ioXFRW9+/fvXwzNzMzMDDt37lysp6/3/siRIyHKysq+tbW1"
    "7+AK8vPzgyUlJSfisl1fX9/IxtpmjbWVdWZEREQVshwTAwMDAysr6xZxcXFdfX19OWwGvH3z"
    "NltZRXnuixcvorS1teehuI6BgYHh2LFjf0NCQn4cP3487devXw8ZGBgkGBkZJRgZGSX4+fjN"
    "5eXlnb99//ZQSUnp09SpUzchG8ACjw5GxvW+vr7qz549a2b4j4gddg72TxISEtW7d+/ucXZ2"
    "jlu7di32aLS3t5e7efPmRB4eHiZGqPB/hv8Mv3///v/t6zdBD0+PfYsXL25E9x7cBSYmJq/U"
    "1dXX3bh+I15HV2emiorKk8+fPzMcO3Ysn4OD47CgoGAbtvBhhjGOHz/+h5mJOfrrt69q7969"
    "ez1nzpzlQoJC7Ldv3c5++vSpJjs7+7Sbt27+x+kCBgYGBh9fn9VXrlwR0tPT23js2DEGSSnJ"
    "x/wC/Nt5eHieTp48+R8RCXUAAAAvH6MMwTiV1AAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxMC0w"
    "Mi0xMVQxMjo0OToyMy0wNjowMBZjrrgAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMDktMDktMTdU"
    "MjI6MTE6NDgtMDU6MDBjfHcmAAAAAElFTkSuQmCC")

Deposito16x16 = PyEmbeddedImage(
    "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAA"
    "CXBIWXMAAABIAAAASABGyWs+AAAACXZwQWcAAAAQAAAAEABcxq3DAAACdklEQVQ4y32TO0yT"
    "URiGn783+tMQtbQhaiKiCIkQb40LtKUVIzCQuEBcNIZEEoVBG6TNn2hccNCpdcDoYsLgRJya"
    "tCUIDR0A5SogtygymOiAGAtt5T+ti9USLmc8532efPnO98E+p7OzM6MoSgbI2yuj2Q8utFjI"
    "N5lQFCW5l0TaC7ZYLEQiETKA2+0mmUhgNpsPeTye9X0ryIU7Ojpob2vj3egosiyztrb2IxqN"
    "HsvN63aDw+EwXq+X2tpaAGRZxu8P4HDY6evr+7KwsHChvLx8YpsgF/b5fLhcrn/irMgfCOCw"
    "2+np6RkHZCApZWGr1UooFMLn81Fmc+Dr/YBhNcanb5sUu2/wpMHK9PAgfn8Ap9NBPB6nq6sr"
    "X/J6vRmLxUIwGERRFErO2al6tkhN3iKdV8+zJdI87h1nUlvJ2N1SpkeG8PsDVNur2dzYQFtR"
    "UfGov78/1dTcnG5uatJ6gt/JW43xsLGcjJpCUpM4y8wMDE8wu3WY9roKEskkz7u7f1qtVqME"
    "XAZWxsbGliorKyl5+hnPwShHiwqpaajn1/o60VCYma9xgoZ65u4dZ2ZmBpvNdgoo1gBDwDKA"
    "KgRaCYbfT/Jxfh69Xo9Ob2BkdJS5+UUMWglViGxvl4GYDkhlb4SqUlcq83roAItTb4gNxdiI"
    "x0kkEiwdaaS11IhQ1dyfT22bA1UIHrgKeLt8ndmBDIblfpA0/D5ZzwnnNe5XFyD+V7BzkNJC"
    "YNJJDLQU4T99m8GVFrQaiUsledy5aMKoTSNEZm+BKgQSYNSAt0rGWyXnvAqECtvxv8t081br"
    "mStu15RRlncE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NzMTkXaKu8w7bLJIrVbbLQ0OvpD/vo2/BwA407mg9euIOgAAAABJRU5ErkJg"
    "gg==")

CodigoBarraIncorrecto16x16 = PyEmbeddedImage(
    "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwY"
    "AAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAJWSURBVHja"
    "xJNLb4xhGIav5/3ebw5tp9PO1wPSRqRFk7abdpSNDiGaWrJwjIWFiNjZ0MRCSNhIuyCxEhG/"
    "wIqIw4KNiA0htCToVLQRxjdT853e16KaqK2F6wfcyf081y3WWv4FxT+iS6XS6tly+WS+Od9l"
    "sQmAEgABUQgWRLDWEgSRk06nnn4uz16tBwEigm5pLdy+fv1GsbGxEQuIgDEGLCTWYozBWkMQ"
    "xMx8+szHd2+OnDt7pjWK4wsp10UPDAyu7+lZRxwnBEEAgCghDCKMNRgLYRCitcu6rlWMbinS"
    "vabz/KGDB+IwDC/pJEligPn5eSYmJlBKUSwWefLkMQXPY6B/kIePHtDcnMdra2dsfDfbd+7i"
    "xs1bF08cP+bq5WNYa/GrPo5S1Ot1qrUaG3t7MUlEbXERV7tgEu7dvYObStPbP8Tm0R2ntfz5"
    "EqVQyiEMQ67t24taWCD5tsDYtq1cfv8BR2uUUuQaMnR1Fuhe3flT/W1BkiSMr+0mun+PJJMh"
    "iiPCK5Mc7VtPGIYoJUshTVnyTQ0rPbDW4miNV60g1Srx69doY8m2tNIxV8YCSgTHcXAERGRl"
    "gFKKxBjqmQa076OqPrrynabmPHFHJ6IEpQTHUSyroh3HcQA8z2NqcgqL5dWLl2waKhLNfsKN"
    "YtKj23i2oY9T+w8jSpHNZgFwtevomZm3XyqVHy2ZbJb29g5EoFDyeJ7L0fDtKwrwWwqUhodJ"
    "pVIAGGuoLS4yPTP9Rc/Nze0ZGRk5nsvl8tZaKyJLFiPI755/IyLi+37Fa2u7Jv99jb8GAIur"
    "6AfIbHYMAAAAAElFTkSuQmCC")

CodigoBarraCorrecto16x16 = PyEmbeddedImage(
    "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwY"
    "AAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAJGSURBVHja"
    "xJO7a5NhFMZ/532/XL40Mc2lTS/pENrq0HQpoepgo1gtQjsoDmrBUYv4B2jBQRR0s4vgVIr4"
    "Fzgpgvcq6KKCoG3sYNNWgyA1ac2Xy/c6pAHt2sFnes5y4Pec54gxhp1IsUNZ2Wy2M7+ycjG8"
    "K5w0mDqAEgABUQgGRDDG4DhV7fN536yt5G+XHQcRwWqNRO/Pzs5lWlpaMIAIuK4LBurG4Lou"
    "xrg4To3c8hpfv3w+e/XK5Ui1Vrvu9Xiw0unB/t7eFLVaHcdxABAlVJwqrnFxDVScCpbloavD"
    "ZmTfJD1diWuTZ07XKpXKTater9cACoUC09PTKKXIZDLMz78kGouRHhjkydPHJPodAirF2OhJ"
    "Do0eZe7uvRsXps55rGYYxhiKpSJaKcrlMqVSCb/fplKtEOlbpu6GoOrj0cMHeLw++gaG2Dty"
    "+FIjr+ZJlEIpjUjDa62h/S3R7g1K+Q60ZaGVIhTwk0xE6elM/FbbW5Dan8fufwEC8d3fCKZe"
    "sfAsiYigRFBKUEoRCtqEg4F/e2CMobAUxJd8zZHzP0gf+8jP9+NUyw3S5hKtNVq2ZrYhbBYi"
    "rM0fx9P+iQ/PowTqe9BKNfC0QilBa0WzKpbWWgPEYjFmbs2AgM/r493SAbJjg8Qj3UyMT6C0"
    "wtIWBrBtGwCP5dFWLrfwfX39V6vftmlra0cEDHBw6FTDG0OkNcLfP+Mal43NTRZzi9+t1dXV"
    "E8PDw1OhUChsjDEi0mgxgmxxbpeISLFYXI/F43fkv3/jnwEA2U3MWwZfGgwAAAAASUVORK5C"
    "YII=")
    